package com.bestow.flowable.service.impl;

import java.util.List;
import com.bestow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestow.flowable.mapper.WflApproveCandidateRuleMapper;
import com.bestow.flowable.domain.WflApproveCandidateRule;
import com.bestow.flowable.service.IWflApproveCandidateRuleService;

/**
 * 候选人审批规则Service业务层处理
 * 
 * @author liliu
 * @date 2022-09-07
 */
@Service
public class WflApproveCandidateRuleServiceImpl implements IWflApproveCandidateRuleService 
{
    @Autowired
    private WflApproveCandidateRuleMapper wflApproveCandidateRuleMapper;

    /**
     * 查询候选人审批规则
     * 
     * @param candidateRuleId 候选人审批规则主键
     * @return 候选人审批规则
     */
    @Override
    public WflApproveCandidateRule selectWflApproveCandidateRuleByCandidateRuleId(Long candidateRuleId)
    {
        return wflApproveCandidateRuleMapper.selectWflApproveCandidateRuleByCandidateRuleId(candidateRuleId);
    }

    /**
     * 查询候选人审批规则列表
     * 
     * @param wflApproveCandidateRule 候选人审批规则
     * @return 候选人审批规则
     */
    @Override
    public List<WflApproveCandidateRule> selectWflApproveCandidateRuleList(WflApproveCandidateRule wflApproveCandidateRule)
    {
        return wflApproveCandidateRuleMapper.selectWflApproveCandidateRuleList(wflApproveCandidateRule);
    }

    /**
     * 新增候选人审批规则
     * 
     * @param wflApproveCandidateRule 候选人审批规则
     * @return 结果
     */
    @Override
    public int insertWflApproveCandidateRule(WflApproveCandidateRule wflApproveCandidateRule)
    {
        wflApproveCandidateRule.setCreateTime(DateUtils.getNowDate());
        return wflApproveCandidateRuleMapper.insertWflApproveCandidateRule(wflApproveCandidateRule);
    }

    /**
     * 修改候选人审批规则
     * 
     * @param wflApproveCandidateRule 候选人审批规则
     * @return 结果
     */
    @Override
    public int updateWflApproveCandidateRule(WflApproveCandidateRule wflApproveCandidateRule)
    {
        wflApproveCandidateRule.setUpdateTime(DateUtils.getNowDate());
        return wflApproveCandidateRuleMapper.updateWflApproveCandidateRule(wflApproveCandidateRule);
    }

    /**
     * 批量删除候选人审批规则
     * 
     * @param candidateRuleIds 需要删除的候选人审批规则主键
     * @return 结果
     */
    @Override
    public int deleteWflApproveCandidateRuleByCandidateRuleIds(Long[] candidateRuleIds)
    {
        return wflApproveCandidateRuleMapper.deleteWflApproveCandidateRuleByCandidateRuleIds(candidateRuleIds);
    }

    /**
     * 删除候选人审批规则信息
     * 
     * @param candidateRuleId 候选人审批规则主键
     * @return 结果
     */
    @Override
    public int deleteWflApproveCandidateRuleByCandidateRuleId(Long candidateRuleId)
    {
        return wflApproveCandidateRuleMapper.deleteWflApproveCandidateRuleByCandidateRuleId(candidateRuleId);
    }
}
